set(EXM_NAME hb_client)

include_directories(${CMAKE_SOURCE_DIR}/src/include)

file(GLOB_RECURSE testHeaderFiles "${CMAKE_SOURCE_DIR}/src/include/*.h")
set(INCLUDE_FILES_LIST
    ${testHeaderFiles}
)

set(CMAKE_C_FLAGS "-O0 -rdynamic -g -funwind-tables -ffunction-sections")

set(C_SOURCE_FILES_LIST
    hbexample.cpp
)

add_definitions(-DLOGGER_OUTPUT_COMPILE_ENABLE)
#-------------------------------------------
#set(LOG_EXM_NAME mv_logger)
#include_directories("/mnt/e/code/maxvision/libIPCProtocol/target/include")
#set(LOG_EXM_SOURCE_FILES_LIST
#    mv_logger.cpp
#)

#file(GLOB_RECURSE dbHeaderFiles "/mnt/e/code/maxvision/libIPCProtocol/target/include/*.h")
#set(LOG_INCLUDE_FILES_LIST
#    ${dbHeaderFiles} 
#   ${testHeaderFiles}
#)
#--------------------------------------------

link_directories(${CMAKE_SOURCE_DIR}/target/lib)

# link_directories(${CMAKE_SOURCE_DIR}/submodule/mvLibIpcprotocol/target/lib)

#link_directories(/mnt/e/code/maxvision/libIPCProtocol/target/lib)

ADD_EXECUTABLE(${EXM_NAME} ${INCLUDE_FILES_LIST} ${C_SOURCE_FILES_LIST})

target_link_libraries(${EXM_NAME} mv_heartbeat)

#ADD_EXECUTABLE(${LOG_EXM_NAME} ${LOG_INCLUDE_FILES_LIST} ${LOG_EXM_SOURCE_FILES_LIST})

#target_link_libraries(${LOG_EXM_NAME} btrace_api IPCProtocol ${JSON_CPP_LIBS})

INSTALL(TARGETS ${EXM_NAME} 
        RUNTIME DESTINATION bin
)

INSTALL(FILES ${C_SOURCE_FILES_LIST}
       DESTINATION example
)